﻿
Partial Class Apps_report_stp_auth_department
    Inherits System.Web.UI.Page

    Protected Sub ddlStpMainSystem_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlStpMainSystem.SelectedIndexChanged

        Try
            ddlStpMenuSystem.DataBind()
        Catch ex As Exception
            GenericHelper.ShowAlert(Me, ex)
        End Try

    End Sub

    Protected Sub btnFilter_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFilter.Click

        Try
            '//   Dim url = "../Reports/report_stp_auth_department1.aspx?department_code={0}&main_system_code={1}&menu_system_code={2}&department_status={3}&str_department_code={4}&str_main_system_code={5}&str_menu_system_code={6}&str_department_status={7}"
            Dim url = "../Reports/report_stp_auth_department2.aspx?department_code={0}&main_system_code={1}&menu_system_code={2}&department_status={3}&str_department_code={4}&str_main_system_code={5}&str_menu_system_code={6}&str_department_status={7}"
            url = String.Format(url, _
                                ddlDepartment.SelectedValue, _
                                ddlStpMainSystem.SelectedValue, _
                                ddlStpMenuSystem.SelectedValue, _
                                ddlStatus.SelectedValue, _
                                HttpUtility.UrlEncode(ddlDepartment.SelectedItem.Text), _
                                HttpUtility.UrlEncode(ddlStpMainSystem.SelectedItem.Text), _
                                HttpUtility.UrlEncode(ddlStpMenuSystem.SelectedItem.Text), _
                                HttpUtility.UrlEncode(ddlStatus.SelectedItem.Text))

            Dim script = String.Format(" window.open('{0}','_blank');", url)

            ScriptManager.RegisterStartupScript( _
            Me, _
            Me.GetType(), _
            Guid.NewGuid().ToString(), _
            script, _
            True _
            )
        Catch ex As Exception
            GenericHelper.ShowAlert(Me, ex.Message)
        End Try

    End Sub

    Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete
        Dim BreadCrumpBG As HtmlControl = Page.Master.FindControl("tdBreadCrump")
        Dim BreadCrump As Literal = Page.Master.FindControl("ltrBreadCrump")
        CodeMatrix.Business.GenericData.SetBreadCrump(BreadCrumpBG, BreadCrump, 55)
    End Sub
End Class
